from PIL import Image
im = Image.open('./img/侧脸美女杨紫高清电脑壁纸.jpg')
w,h = im.size


image_row = 4
image_col = 4

import os
#存储名字
names = os.listdir('./img')

new_img = Image.new('RGB',(image_row*w,image_col*h))
for i in range(image_row):
    for j in range(image_col):
        p_img = Image.open('./img/'+names[i*image_col+j])
        new_img.paste(p_img,(j*w,i*h))
new_img.save('./img/合成图片.jpg')
